home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.7 KB | 101 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWEdCmd.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWEDCMD_H
- #define FWEDCMD_H
-
- #ifndef FWCMD_H
- #include "FWCmd.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef SOM_ODDraft_xh
- #include <Draft.xh>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //==============================================================================
- // Forward Declarations
- //==============================================================================
-
- class FW_CLASS_ATTR FW_CPart;
- class FW_CLASS_ATTR FW_CFrame;
- class FW_CLASS_ATTR FW_CSelection;
-
- //==============================================================================
- // FW_CEditCommand - handles Cut, Clear, Paste, PasteAs commands
- // Subclass to make these commands Undo-able
- //==============================================================================
-
- class FW_CLASS_ATTR FW_CEditCommand : public FW_CCommand
- {
- public:
- FW_DECLARE_CLASS
-
- public:
- FW_CEditCommand(Environment* ev,
- ODCommandID id,
- FW_CFrame* frame,
- FW_Boolean canUndo);
- // Constructor: undo/redo strings = NULL
-
- virtual ~ FW_CEditCommand();
-
- // --- Don't override ---
- virtual void DoIt(Environment* ev); // Override
-
- FW_Boolean HandleClear(Environment* ev);
- void HandleCopy(Environment* ev);
- FW_Boolean HandleCut(Environment* ev);
- FW_Boolean HandlePaste(Environment* ev);
- FW_Boolean HandlePasteAs(Environment* ev);
-
- // --- Override, call Inherited ---
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
-
- // --- May override, don't call Inherited ---
- virtual void DoClear(Environment* ev);
- virtual void DoCut(Environment* ev);
- virtual void DoPaste(Environment* ev);
- virtual void DoPasteAs(Environment* ev);
-
- protected:
- // ----- Clipboard -----
- void Copy(Environment* ev, FW_Boolean allowPublish);
-
- // ----- Linking/PasteAs -----
- FW_Boolean HandlePasteAsDialog(Environment* ev, ODPasteAsResult& pasteAsResult,
- FW_Boolean& handledIt);
-
- virtual FW_Boolean DoPasteTranslation(Environment* ev, ODPasteAsResult& pasteAsResult);
- // Override to translate the data and paste it.
-
- virtual FW_Boolean DoPasteAsEmbed(Environment* ev, ODStorageUnit* storageUnit);
- // Override to paste an embedded part.
-
- private:
- ODUpdateID fUpdateID; // update id of clipboard for Cut, Paste
- ODCloneKind fCloneKind; // cloneKind of operation
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-